package com.dy.nygl.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.nygl.mapper.ElecStatusMapper;
import com.dy.nygl.pojo.ElecStatus;
import com.dy.nygl.service.ElecStatusService;

@Service("elecStatusService")
public class ElecStatusServiceImpl implements ElecStatusService {

	@Resource(name="elecStatusDao")
	public ElecStatusMapper elecStatusDao;

	@Override
	public List<ElecStatus> selectByName(String name) {
		List<ElecStatus> list=elecStatusDao.selectByName(name);
		return list;
	}

	@Override
	public void updateInfo(ElecStatus elecStatus) {
		ElecStatus elecStatus2=new ElecStatus();
		elecStatus2.setId(elecStatus.getId());
		elecStatus2.setName(elecStatus.getName());
		elecStatus2.setStatus(elecStatus.getStatus());
		elecStatus2.setData(elecStatus.getData());
		elecStatusDao.updateByPrimaryKeySelective(elecStatus2);
	}

	@Override
	public List<ElecStatus> selectAll() {
		List<ElecStatus> list=elecStatusDao.selectAll();
		return list;
	}

	@Override
	public ElecStatus selectById(int id) {
		ElecStatus elecStatus=elecStatusDao.selectByPrimaryKey(id);
		return elecStatus;
	}

	
}
